                    function sliceSize2(dataNum, dataTotal) {
                        return (dataNum / dataTotal) * 360;
                    }
                    function addSlice2(sliceSize2, pie2Element, offset, sliceID, color) {
                        $(pie2Element).append("<div class='slice " + sliceID + "'><span></span></div>");
                        var offset = offset - 1;
                        var sizeRotation = -179 + sliceSize2;
                        $("." + sliceID).css({
                            "transform": "rotate(" + offset + "deg) translate3d(0,0,0)"
                        });
                        $("." + sliceID + " span").css({
                            "transform": "rotate(" + sizeRotation + "deg) translate3d(0,0,0)",
                            "background-color": color
                        });
                    }
                    function iterateSlices2(sliceSize2, pie2Element, offset, dataCount, sliceCount, color) {
                        var sliceID = "s" + dataCount + "-" + sliceCount;
                        var maxSize = 179;
                        if (sliceSize2 <= maxSize) {
                            addSlice2(sliceSize2, pie2Element, offset, sliceID, color);
                        } else {
                            addSlice2(maxSize, pie2Element, offset, sliceID, color);
                            iterateSlices2(sliceSize2 - maxSize, pie2Element, offset + maxSize, dataCount, sliceCount + 1, color);
                        }
                    }
                    function createpie2(dataElement, pie2Element) {
                        var listData = [];
                        $(dataElement + " span").each(function () {
                            listData.push(Number($(this).html()));
                        });
                        var listTotal = 0;
                        for (var i = 0; i < listData.length; i++) {
                            listTotal += listData[i];
                        }
                        var offset = 0;
                        var color = [
                          "crimson",
                          "forestgreen",
                          "cornflowerblue",
                          "olivedrab",
                          "orange",
                          "tomato",
                          "purple",
                          "turquoise",
                          "navy",
                          "gray" 
                        ];
                        for (var i = 0; i < listData.length; i++) {
                            var size = sliceSize2(listData[i], listTotal);
                            iterateSlices2(size, pie2Element, offset, i, 0, color[i]);
                            $(dataElement + " li:nth-child(" + (i + 1) + ")").css("border-color", color[i]);
                            offset += size;
                        }
                    }
                    createpie2(".pie2ID2.legend", ".pie2ID2.pie2");
